<?php
require(dirname(__FILE__)."/config.php");
CheckPurview('plus_幻灯片管理');
require_once DEDEINC."/typelink.class.php";
require_once(DEDEINC."/customfields.func.php");
require_once(DEDEADMIN."/inc/inc_archives_functions.php");
if(empty($dopost)) $dopost = '';

if($dopost=="add")
{
	$sortrank = trim($sortrank);
	//处理远程图片
    if(empty($ddisremote))
    {
        $ddisremote = 0;
    }
    $litpic = GetDDImage('none', $litpic, $ddisremote);
	if(empty($ddisremote2))
    {
        $ddisremote2 = 0;
    }
    $litimg = GetDDImage('none', $litimg, $ddisremote2);
	$query = "INSERT INTO #@__flash(typeid,title,litpic,litimg,content,arcurl,sortrank) VALUES ('$typeid','$title','$litpic','$litimg','$content','$arcurl','$sortrank');";
	$dsql->ExecuteNoneQuery($query);
	ShowMsg("成功增加一个幻灯片！","flash_main.php");
	exit();
}

$dsql->Execute('dd','SELECT * FROM `#@__flashtype` ORDER BY id DESC');
$option = '';
while($arr = $dsql->GetArray('dd'))
{
    $option .= "<option value='{$arr['id']}'>{$arr['typename']}</option>\n\r";
}
include DedeInclude('templets/flash_add.htm');
?>